import QtQuick 1.1
import com.nokia.meego 1.0

Page {
    property string mac: "AABBCCDDEEFF" // dummy value that gets replaced
    property int macTab: 0              // dummy value that gets replaced
    orientationLock: PageOrientation.LockPortrait
    anchors.fill: parent
    Button {
        id: button1
        //anchors.bottom: parent.bottom
        //anchors.bottomMargin: 40
        anchors.top: column1.bottom
        anchors.topMargin: 50
        anchors.horizontalCenter: parent.horizontalCenter
        Label {anchors.centerIn: button1; text: "Wake up!"; font.pixelSize: 40; }
        onClicked: {
            appWindow.sendMacToCPP(macTab);
        }
    }
    Button {
        id: button2
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 50
        anchors.horizontalCenter: parent.horizontalCenter
        Label {anchors.centerIn: button2; text: "XBMC remote"; font.pixelSize: 40; }
        onClicked: {
            appWindow.pageStack.push(Qt.resolvedUrl("XbmcUI.qml"));
        }
    }
    Column {
        id: column1
        anchors.top: parent.top
        Label{
            text: qsTr("First 6 hex digits of MAC")
            anchors.horizontalCenter: parent.horizontalCenter
        }
        Row {
            id: row1
            spacing: 2
            anchors.horizontalCenter: parent.horizontalCenter
            Column{ id: col1;
                ToolIcon { iconId: "toolbar-up"; onClicked: {appWindow.macIncr(macTab,12)} }
                Label{ text: mac.charAt(12-12);anchors.horizontalCenter: col1.horizontalCenter; font.pixelSize: 50}
                ToolIcon { iconId: "toolbar-down"; onClicked: {appWindow.macDecr(macTab,12)} }
            }
            Column{ id: col2;
                ToolIcon { iconId: "toolbar-up"; onClicked: {appWindow.macIncr(macTab,11)} }
                Label{ text: mac.charAt(12-11);anchors.horizontalCenter: col2.horizontalCenter; font.pixelSize: 50}
                ToolIcon { iconId: "toolbar-down"; onClicked: {appWindow.macDecr(macTab,11)} }
            }
            Column{ id: col3;
                ToolIcon { iconId: "toolbar-up"; onClicked: {appWindow.macIncr(macTab,10)} }
                Label{ text: mac.charAt(12-10);anchors.horizontalCenter: col3.horizontalCenter; font.pixelSize: 50}
                ToolIcon { iconId: "toolbar-down"; onClicked: {appWindow.macDecr(macTab,10)} }
            }
            Column{ id: col4;
                ToolIcon { iconId: "toolbar-up"; onClicked: {appWindow.macIncr(macTab,9)} }
                Label{ text: mac.charAt(12-9);anchors.horizontalCenter: col4.horizontalCenter; font.pixelSize: 50}
                ToolIcon { iconId: "toolbar-down"; onClicked: {appWindow.macDecr(macTab,9)} }
            }
            Column{ id: col5;
                ToolIcon { iconId: "toolbar-up"; onClicked: {appWindow.macIncr(macTab,8)} }
                Label{ text: mac.charAt(12-8);anchors.horizontalCenter: col5.horizontalCenter; font.pixelSize: 50}
                ToolIcon { iconId: "toolbar-down"; onClicked: {appWindow.macDecr(macTab,8)} }
            }
            Column{ id: col6;
                ToolIcon { iconId: "toolbar-up"; onClicked: {appWindow.macIncr(macTab,7)} }
                Label{ text: mac.charAt(12-7);anchors.horizontalCenter: col6.horizontalCenter; font.pixelSize: 50}
                ToolIcon { iconId: "toolbar-down"; onClicked: {appWindow.macDecr(macTab,7)} }
            }

        }
        /////////////////////////
        /////////////////////////
        /////////////////////////
        /////////////////////////
        /////////////////////////
        Label{
            text: qsTr("Last 6 hex digits of MAC")
            anchors.horizontalCenter: parent.horizontalCenter
        }
        Row {
            id: row2
            spacing: 2
            anchors.horizontalCenter: parent.horizontalCenter
            Column{ id: col7;
                ToolIcon { iconId: "toolbar-up"; onClicked: {appWindow.macIncr(macTab,6)} }
                Label{ text: mac.charAt(12-6);anchors.horizontalCenter: col7.horizontalCenter; font.pixelSize: 50}
                ToolIcon { iconId: "toolbar-down"; onClicked: {appWindow.macDecr(macTab,6)} }
            }
            Column{ id: col8;
                ToolIcon { iconId: "toolbar-up"; onClicked: {appWindow.macIncr(macTab,5)} }
                Label{ text: mac.charAt(12-5);anchors.horizontalCenter: col8.horizontalCenter; font.pixelSize: 50}
                ToolIcon { iconId: "toolbar-down"; onClicked: {appWindow.macDecr(macTab,5)} }
            }
            Column{ id: col9;
                ToolIcon { iconId: "toolbar-up"; onClicked: {appWindow.macIncr(macTab,4)} }
                Label{ text: mac.charAt(12-4);anchors.horizontalCenter: col9.horizontalCenter; font.pixelSize: 50}
                ToolIcon { iconId: "toolbar-down"; onClicked: {appWindow.macDecr(macTab,4)} }
            }
            Column{ id: col10;
                ToolIcon { iconId: "toolbar-up"; onClicked: {appWindow.macIncr(macTab,3)} }
                Label{ text: mac.charAt(12-3);anchors.horizontalCenter: col10.horizontalCenter; font.pixelSize: 50}
                ToolIcon { iconId: "toolbar-down"; onClicked: {appWindow.macDecr(macTab,3)} }
            }
            Column{ id: col11;
                ToolIcon { iconId: "toolbar-up"; onClicked: {appWindow.macIncr(macTab,2)} }
                Label{ text: mac.charAt(12-2);anchors.horizontalCenter: col11.horizontalCenter; font.pixelSize: 50}
                ToolIcon { iconId: "toolbar-down"; onClicked: {appWindow.macDecr(macTab,2)} }
            }
            Column{ id: col12;
                ToolIcon { iconId: "toolbar-up"; onClicked: {appWindow.macIncr(macTab,1)} }
                Label{ text: mac.charAt(12-1);anchors.horizontalCenter: col12.horizontalCenter; font.pixelSize: 50}
                ToolIcon { iconId: "toolbar-down"; onClicked: {appWindow.macDecr(macTab,1)} }
            }

        }

    }
}
